NES - Jackal (USA).NES hack
author: RayofJay
date: 16Dec2019

*******
READ ME
*******


***
******
*********
************
READ EVERYTHING.  YOU MAY CORRUPT THE ROM IF YOU USE THE LEVEL EDITOR INCORRECTLY
************
*********
******
***

VERSION:
1.0 - Initial Release
2.6 - Corrected some resolution issues between varying OSs
2.7.1 - More resolution corrections.  Moved some things around on teh form to be mroe user friendly and make better use of space
	Added optional grid overlay for the level layout


Reference the accompanying Jackal Memory Usage.xlsx (or PDF) file for Jackal information regarding
	The layout of RAM
	The dissection of the ROM (data tables, logic, intent, modifications, etc.)
	Level Data
	Sprite Data

Note the accompanying utility Jackal Level Editor (written in VB.Net 2013).  This provides access to all the levels':
	Tile layouts
	palettes
	helipad flashing lights palettes and screen start/stop triggers for flashing palettes
	Enemy spawn locations
	Enemy types (what enemy spawns where)



*******************
Jackal Level Editor
*******************

Editor Visual Layout:
 _______________  ____	 _________	 _______
|		||LVL|	|	  |	|	|
|		||SEL|	|  Tile   |	|Enemy  |
|		|   _	|  Select |	|Spawn  |
|    Level	|  |I|	|	  |	|Layout |
|    Layout	|  |_|	|	  |	|_______|
|		| ____	|_________|
|		||OPTI|	 _______________
|		||ONS_|	|   Palettes	|    ____________
|_______________|	|_______________|   |Screen Flash|
	


Level Layout:
The level layout shows the entire level.  Each level is 512 pixels wide (2 screens worth).
Levels 1-5 are 12 screens tall.  Level 6 is 14 screens tall.
The tiles are defined as 32x32 pixel sections.  The available tiles are displayed in the Tile select area.
Since the NES resolution is 256x240, The level layout displays horizontal black lines where tiles are chopped off to fit in the 240 vertical resolution.
The very bottom row has 24 pixels removed instead of just 16.
Once a tile is chosen in Tile Select, LEFT click to overwrite the level layout.
Hold down the LEFT mouse button and drag to overwrite many level tiles with 1the same tile multiple times.
RIGHT click to select the tile under the cursor for placement elsewhere
The mouse wheel is tied to to the level layout and will scroll through the level

I:
This shows what Tile/Object is currently selected for editing/placement.


Tile Select:
All the level's available tiles are shown here.  These tiles are rendered straight from the graphics data in the ROM with palettes applies.
	i.e. the image is not stored anywhere, but built every time.
LEFT or RIGHT click to select a tile.  It will appear in 'I'.


Enemy Spawn Layout:
This shows the order in which enemies spawn.  Hover the mouse over the picture and it will display information about the enemy (Internal ID, (X,Y) spawn position, and top or bottom spawn)
the horizontal position is the distance in pixels from the leftmost level edge divided by 4 (Spawn position = X*4)
The Y position is in pixels
A horizontal position 0-7F spawns at the top of the screen.
A horizontal position 80-FF spawns at the bottom of the screen.
	The editor handles this behind the scenes.  LEFT click a sprite and change the radio button to change top/bottom spawning per sprite.
To move an enemy position around, RIGHT click the enemy and it will appear in 'I'.  now you may left click the Level Layout and move the enemy around.
To edit the enemy, LEFT click the enemy in the spawn layout.
The 'salmon/pink' back color of the sprite is made transparent when rendered on the Level layout
After an enemy is select, you may use the Arrow keys to move the enemy around for finer detail.
	Use SHIFT+Arrow key to move large distances at a time.

NOTE: VERTICAL ENEMY SPAWN POSITIONS THAT ARE ODD ONLY ACTUALLY SPAWN IF BOTH PLAYERS HAVE UPGRADED WEAPONRY.  SPECIFICALLY IF THE COMBINED UPGRADE TOTAL IS >= 3.
MEANING ONE PLAYER HAS A FULL BAZOOK AND THE OTHER ONLY A GRENADE
OR ONE PLAYER HAS A SINGLE BAZOOKA AND THE OTHER PLAY HAS LEVEL 2 BAZOOKA, ETC.
This allows the designer to make a level harder if the player is better at playing the game.  This is a default game feature.

NOTE: DO NOT PLACE ANY ENEMIES ON THE LEVEL WITH A VERTICAL POSITION BETWEENF EF AND FF (EF,FF INCLUDED).
DO NOT REPLACE THE F0,F1,F2 OBJECTS WITH NORMAL ENEMY OBJECTS.  THIS WILL CORRUPT THE GAME DATA.
THESE THREE SPECIAL VALUES ONLY CONSUME 2 BYTES IN THE ROM.  NORMAL ENEMY OBJECTS CONSUME 3 BYTES.
EF marks the end of the screen.  F0,F1,and F2 have special meaning..  These are also displayed with F0,F1,F2 graphics on the level layout.
F0 triggers the screen scroll for initiating the level's boss battle (hitting the actual boss load trigger cause the scrolling to stop)
F1 reloads the original level's BG and sprite palettes
F2 Sometimes sets the sprite palette data to something new (e.g. Level 1 boss updates sprite data, though there's no real color change), 
	sometimes this also upates graphic data (BG and/or Sprite graphics).  level specific

NOTE: Objects despawn once 070X=1 and 056X=40 (056X increments as you move upward).  For the boss screen, make sure enemies are before
	vertical position #A4.  Otherwise, they will remain in memory during the boss fight, consuming a sprite slot

NOTE: IF YOU ARE EDITING MY ROM HACK, HORIZONTAL POSITIONS 7D,7E,7F HAVE SPECIAL MEANING
7D reads from the RNG RAM register 001A and randomnly places the enemy between 00-3F horizontally.  This is somewhere on the left half of the level.  vertical is unaffected
7E reads from the RNG RAM register 001A and randomnly places the enemy between 20-5F horizontally.  This is somewhere in the middle 50% of the level.  vertical is unaffected
7F reads from the RNG RAM register 001A and randomnly places the enemy between 40-7F horizontally.  This is somewhere on the right half of the level.  vertical is unaffected


LVL SEL (Level Select):
Click to choose what level to display/edit


Palette:
Gives access to edit each level's color palettes, as well as the palette swap for the flashing helipad lights.
Some levels have an F2 object.  This can load new graphics and sometimes a new palette.  usually used for bosses.
	If a level has an F2 object that affects a levels palette, these F2 palettes will appear in this section for modification
NOTE: Levels 1,2,3,4,6 use the first palette set for the helipad lights.  Level 5 uses the second palette set.


Screen Flash:
Defines the start and stop screen for the helipad light flashing palette swap.  (i.e. a value of 7 and 9 changes the palette to the helipad palette set when screen 7 is reached
and reverts the palette back to the normal colors when screen 9 is reached.  I use F and F to turn off the palette swap (This can be useful, for instance, on Level 1 where the
helipad lights and the water tiles use the same palette.  If the helipad lights flash while water is on the screen...the water flashes too)).


OPTIONS:
Level Grid Lines: Checking this check box will over layout a green mesh/grid showing the break between tiles


Other:
Press CTRL-S to save the ROM (all levels, enemy placements, palettes, etc).  This will also sort the enemy list by spawning position ascending.
	NOTE: CTRL-S SAVES TO THE SAME FILENAME THAT WAS OPENED.  YOU MUST RENAME THE ROM FILE PRIOR TO OPENING IT
The level editor will detect unsaved changes and prompt you before exiting without saving.
Right now, some Level 3, 5 and 6 graphics, boss mainly, look like garbage.  probably pulling from the wrong location.  I believe the pattern table is updated right before the boss
	appears.  You can still use the garbage looking tile.  the pattern table is still updated correctly.
ALT+F4 closes the application as usual

You may contact me at:
jpetheman@hotmail.com

